package parttwo.homework;

/**
 * 定义手机卡类
 */

public class MobilePhoneCard {

   private String    cardType;      //卡类型
   private long       cardNum;      //卡号
   private String    userName;      //用户名
   private String    password;      //密码
   private double    credit;        //账户余额
   private double    talkingTime;   //通话时长(分钟)
   private double    mobileData;    //上网流量

//    无参构造方法
    public MobilePhoneCard() {
    }
//      有参构造方法
    public MobilePhoneCard(String cardType, long cardNum, String userName, String password,
                           double credit, double talkingTime, double mobileData) {
        setCardType(cardType);
        setCardNum(cardNum) ;
        setUserName(userName) ;
        setPassword(password)  ;
        setCredit(credit) ;
        setTalkingTime(talkingTime) ;
        setMobileData(mobileData) ;
    }

//    提供公有的set get 方法
    public String getCardType() {
        return cardType;
    }
    public void setCardType(String cardType) {
        this.cardType = cardType;
    }
    public long getCardNum() {
        return cardNum;
    }
    public void setCardNum(long cardNum) {
        this.cardNum = cardNum;
    }
    public String getUserName() {
        return userName;
    }
    public void setUserName(String userName) {
        this.userName = userName;
    }
    public String getPassword() {
        return password;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    public double getCredit() {
        return credit;
    }
    public void setCredit(double credit) {
        this.credit = credit;
    }
    public double getTalkingTime() {
        return talkingTime;
    }
    public void setTalkingTime(double talkingTime) {
        this.talkingTime = talkingTime;
    }
    public double getMobileData() {
        return mobileData;
    }
    public void setMobileData(double mobileData) {
        this.mobileData = mobileData;
    }
//    提供公有的方法，对信息进行打印。
    public void show( ){
       System.out.println("卡号为:"+getCardNum()+" 的用户 "+getUserName()+
               " ,当前您的余额为" + getCredit()+"元");
   }

}
